#!/bin/bash

if [ "$#" -ne 1 ]; then
    echo "Usage: $0 update.img"
    exit 1
fi


IMG="$1"
cp "$IMG" Linux_Pack_Firmware/update.img

cd Linux_Pack_Firmware
./unpack.sh
mv output/Image/* ../rockdev/
mv output/MiniLoaderAll.bin ../rockdev/
mv output/parameter.txt ../rockdev/
mv output/package-file ../rockdev/
cd -
